package net.hn.hnms.biz.sewage.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Objects;

/**
 * @author 智呈物联 nzw
 * @date 2022/9/22
 */
@Entity
@Table(name = "industrial_wastewater_ammonia_nitrogen", schema = "wscl", catalog = "huaneng-safety")
public class IndustrialWastewaterAmmoniaNitrogenEntity {
    private Long id;
    private Date ammoniaNitrogenTime;
    private BigDecimal ammoniaNitrogenValue;
    private Long shiftId;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "custom-id")
    @GenericGenerator(name = "custom-id", strategy = "net.hn.hnms.biz.sewage.util.CustomIDGenerator")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "ammonia_nitrogen_time")
    public Date getAmmoniaNitrogenTime() {
        return ammoniaNitrogenTime;
    }

    public void setAmmoniaNitrogenTime(Date ammoniaNitrogenTime) {
        this.ammoniaNitrogenTime = ammoniaNitrogenTime;
    }

    @Basic
    @Column(name = "ammonia_nitrogen_value")
    public BigDecimal getAmmoniaNitrogenValue() {
        return ammoniaNitrogenValue;
    }

    public void setAmmoniaNitrogenValue(BigDecimal ammoniaNitrogenValue) {
        this.ammoniaNitrogenValue = ammoniaNitrogenValue;
    }

    @Basic
    @Column(name = "shift_id")
    public Long getShiftId() {
        return shiftId;
    }

    public void setShiftId(Long shiftId) {
        this.shiftId = shiftId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IndustrialWastewaterAmmoniaNitrogenEntity that = (IndustrialWastewaterAmmoniaNitrogenEntity) o;
        return id == that.id &&
                shiftId == that.shiftId &&
                Objects.equals(ammoniaNitrogenTime, that.ammoniaNitrogenTime) &&
                Objects.equals(ammoniaNitrogenValue, that.ammoniaNitrogenValue);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, ammoniaNitrogenTime, ammoniaNitrogenValue, shiftId);
    }
}
